Stories have different genres and styles: mystery, romance, thriller, sci-fi, etc. Similarly, graphics have different formats, different ways of presenting information.

Consider these graphics:
Source
Source this blog
The caption
From Andy Z
From Andy Z
From Andy Z, Source
From Andy Z
source
heat map
Another heat map
Parallel Coordinates
Stacked Bar Chart
Trying too hard!

There is great diversity here. The various graphics have different formats, use different symbols, differ in complexity. Some have bars, some have lines, some have trees, some vary color over an area. Each one of the graphics was thought by the person who created it to convey a message effectively for a given purpose. The purpose might have been to organize data or — in the worst cases — to decorative. The designer might have displayed good judgement or bad; the graphic might be effective or not.

To make effective graphics, it helps to be able to think about the different kinds of graphics and which kinds might advance your purpose. But what is the meaning of “different kinds of graphics”?

To get a start, look carefully at the collection and try to identify sets of individual graphs that have something important in common about the way they present data. Try to imagine the sort of data that might have gone in to making the graphs.

The Grammar of Graphics

English grammar (and that of other languages) is often used to identify which structures are correct and which incorrect. This is a normative or prescriptive use. For instance, here is a correct sentence:

“Four horses pulled the king’s carriage.”

versus

“King four’s carriage horses.”

“Amy gave Bill a pen.”

And here is a another expression that uses many of the same words:

“Pen Bill Amy a.”

The first is comprehensible; a real sentence. It follows the rules of English grammar for a sentence. This one has a noun, a verb, a direct and indirect object. The second does not: it is just a set of words.

There’s another use for grammar: to identify the roles of different words or phrases and help in the construction of complex expressions. You can use grammar to take a sentence apart — noun, verb, object — and then create more complex or detailed sentences by substituting new expressions for the old ones. “Amy gave Bill a pen,” might be restyled, “The girl from the soccer team ended up handing over the red ballpoint to her friend.”

“Four weary old horses reluctantly dragged the worn-out carriage.”

“Horses pulled four kings’ carriages.”

New Changing the sentence, for instance putting modifiers such as “four” or “weary” changes the meaning of the sentence. Some such changes improve the expressiveness of the sentence, others obscure or deceive.

A grammar of graphics has been proposed [Wilkinson, L. (2005),The Grammar of Graphics(2nd ed.). Statistics and Computing, New York: Springer] that enables graphics to be taken apart and put together. One use for such a grammar is to enable people to describe the graphics they want so that computer can do the drawing. The description has to be precise and unambiguous. The use of grammar to define the interface between people and computers is important, [Wickham, A layered grammar of graphics.] particularly for software designers [Ref: ggplot2]

A grammar is also useful for the purpose of designing and thinking about graphics. Among other things, it allows the designer to identify broad types of the components of graphics and to consider how to replace a given form of a component for one that might be better suited for the purpose at hand. Taking apart the sentence, “Amy gave Bill a pen,” allows you to think about how you might make the sentence more effective for your purpose. Noun, verb, indirect object, direct object. So “Amy” can be replaced with “The girl from the soccer team,” or “the teacher,” or “the sales clerk,” among the infinity of possibilities. All of the possibilities play the role of a noun; some of them might accurately describe the situation. Similarly, you might replace the verb (past tense) “gave” with another form of verb phrase that can take a direct and indirect object: “handed,” “will present”, “had given”, “will have had given,” etc.

Once you know that “Amy” is a noun, you can think about what other noun phrases might be more appropriate. The grammar allows you to avoid limiting yourself. For instance, a noun doesn’t have to be a person: “The dispenser gave Bill a pen.”

Usually when describing data-driven graphics [[is that a good name, data-driven]], people resort to naming the objects — scatter plot, histogram, bar plot, pie chart, maps, etc. — and describing the quantities or categories to be rendered: make a scatter plot of weight versus age.

As you’ll see, it can help to have more general categories. The categories and components to be used here may seem at first to be abstract and counter-intuitive. For instance, scatterplots, bar plots, pie charts and maps are all different forms of the same kind of entity, even though they look very different.

Glyphs, Frames, and Fields

Maybe it’s old fashioned, but start with a piece of paper. You’re going to draw a data-driven graphic, and you have the data at hand in the form of a data table, for instance:

Age Height Sex Sport
34 180 M Basketball

and so on.

You might have any of several motivations for making the graph. Suppose the goal of the graph is to demonstrate the relationship between height, weight, and sport played.

Before you do any drawing, you have to decide what position on the paper means. This is called the frame of the graphic. It’s likely that you’ve seen a particular kind of frame, the cartesian coordinate system. In this frame, horizontal position means one thing, vertical position another. In mathematics a Cartesian frame is often drawn like this:

Cartesian Grid

or, without the grid, like this:

No grid

An example of a frame for data-driven graphics:

Each axis has a meaning in terms of the data. In the above graph, position along the horizontal axis represents year, while position along the vertical axis represents the fraction of households.

Such Cartesian coordinates are very common in graphics, but there are others. In the following graphic, position on the vertical axis represents the concentration of enzyme: a quantity. Position along the horizontal axis represents a quality or category: a particular gene.

Of course, a gene is itself not a position on a paper. Position is being used metaphorically to stand for gene. The frame establishes how position corresponds to gene.

Sometimes, the frame is based on physical position. For instance, in this graphic the position on the paper corresponds to a position on the surface of the Earth.

Data tables themselves provide a frame. The vertical position tells which variable, the horizontal position tells which case. We don’t usually think of tables as graphics, but the distinction is one of type-setting, not content.

Exercises

  • Describe the frame for each of these graphics …

  • One of these graphics has a value of a categorical variable represented by vertical position. Which one?

Callout

Radial coordinates. Still two values give position. The pie chart.

Map projections.

CALLOUT

Three-dimensional frames. How three variables can be represented on a piece of paper.

Glyphs

Fields

  • A histogram is a kind of field. There are others.

Three basic kinds of graphics

Data-driven graphics relate data to graphical elements. That’s obvious. A useful basic categorization of “kinds of graphics,” will consider the structure of data and how that structure relates to the structure of the graphics, in particular to glyphs and frames.

Remember that data, as the word is used here, consists of cases and variables. The characterization of graphics in terms of data must identify the roles played by cases and variables. It might not be what you are expecting.

One case per glyph

Two (or more) cases per glyphs

Fields and the collective features of data

[[[It’s not called a glyph here]]] but a field.

Other elements of graphics

  • Guide
  • Scale
  • Axis

Layered graphics